<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<title>Techniki Internetowe - Tenis ziemny</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta http-equiv="content-type" content="applikategoriaion/xhtml+xml; charset=UTF-8"/>
<meta http-equiv="content-style-type" content="text/css"/>
<meta http-equiv="expires" content="0"/>
<link rel="Stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="skrypt1.js"></script>
<script type="text/javascript" src="skrypt2.js"></script>
</head>

<body>

<div id="top">

<div id="NAGLOWEK">
<img src="logo.jpg" alt="logo"></img> 
</div>

<div id="MENU">

<ul>
<li><a href="?kategoria=glowna">Strona główna</a></li>
<li><a href="?kategoria=logowanie">Logowanie</a></li>
<li><a href="?kategoria=ankiety">Ankiety</a></li>
<li><a href="?kategoria=nowa_ankieta">Dodaj ankietę</a></li>
</ul>

<?php
include("config.php");
$login = $_SESSION['login'];
$haslo = $_SESSION['haslo'];
if ((empty($login)) AND (empty($haslo))) 
{
echo '<br />Zaloguj się.<br /><a href="?kategoria=logowanie">Logowanie</a><br />';
}
else
{
$user = mysql_fetch_array(mysql_query("SELECT * FROM logowanie WHERE `login`='$login' AND `haslo`='$haslo' LIMIT 1"));
echo '<br />Witaj '.$user[login].' <br>Jesteś zalogowany(a).';
echo '<br /><a href="?kategoria=wyloguj">Wyloguj.</a>';
}
?>

</div>


<div id="TRESC">

<?php

    if (!isset($_REQUEST["kategoria"]))

    $url="glowna";

    else

    $url=$_REQUEST["kategoria"];

    switch ($url)
    {
        case "glowna":

            include ("glowna.php");
            break;

        case "logowanie":

            include ("logowanie.php");
            break;
			
        case "ankiety":

            include ("ankiety.php");
            break;
			
        case "nowa_ankieta":

            include ("nowa_ankieta.php");
            break;

        case "wyloguj":

            include ("wyloguj.php");
            break;
			
        case "odczyt":

            include ("odczyt.php");
            break;

        case "zapis":

            include ("zapis.php");
            break;
			
        case "formularz":

            include ("formularz.php");
            break;
			
		case "zaglosuj":
		
			include ("zaglosuj.php");
			break;
			
		case "wyniki":
		
			include ("wyniki.php");
			break;
			
        default:

            include ("glowna.php");

    }

?>

</div>

<div id="STOPKA">&copy; 2013</div>

</div>


</body>
</html>